
import java.awt.Color;
import java.awt.Frame;
import java.awt.Panel;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class FramePanelTest extends Frame {
    public static void main(String[] args) {
        FramePanelTest frame = new FramePanelTest();
        frame.setLocationRelativeTo(null);
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
    frame.setVisible(true);
    frame.setSize(400, 300);
    frame.setLayout(null);
    Panel pan = new Panel();
    pan.setSize(400, 300);
    pan.setBackground(Color.YELLOW);
    frame.add(pan);

    }
}


